﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Yto.Entities
{
    /// <summary>
    /// 快照<see cref="Entity{T}"/>
    /// </summary>
    [Serializable]
    public abstract class Entity : Entity<int>
    {
    }

    /// <summary>
    /// IEntity<T>的基本实现
    /// </summary>
    /// <typeparam name="T"></typeparam>
    [Serializable]
    public abstract class Entity<T> : IEntity<T>
    {
        /// <summary>
        /// Unique
        /// </summary>
        [Column("ID")]
        public virtual T Id { get; set; }

        /// inherit
        public override string ToString()
        {
            return $"[{GetType().Name} {Id}]";
        }
    }
}
